package edu.uestc.gene.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * This is the full name of ADR
 * 
 * @author Carl
 * 
 *         2013-10-28
 */
public class AdverseDrugReaction implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String name;
	private String alias;
	private List<Drug> drugs;

	/**
	 * @param name
	 */
	public AdverseDrugReaction(String name) {
		super();
		this.name = name;
		drugs = new ArrayList<Drug>();
	}

	/**
	 * @param name
	 * @param alias
	 */
	public AdverseDrugReaction(String name, String alias) {
		super();
		this.name = name;
		this.alias = alias;
		drugs = new ArrayList<Drug>();
	}

	public void addDrug(Drug drug) {
		drugs.add(drug);
	}

	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof AdverseDrugReaction)) {
			return false;
		}
		AdverseDrugReaction gene = (AdverseDrugReaction) obj;
		return gene.getName().equals(name);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAlias() {
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public List<Drug> getDrugs() {
		return drugs;
	}

	public void setDrugs(List<Drug> drugs) {
		this.drugs = drugs;
	}

}
